#!/usr/local/bin/lua

-- function 
-- closure 
function counter()
	local i=0;
	return function()
		i=i+1;
		return i;
	end
end

local c1=counter()
print(c1())
print(c1())
print(c1())


function myPower(x)
	return function(y)
		return y^x
	end
end

local power2=myPower(2)
local power3=myPower(3)
print(power2(3))
print(power3(5))

-- return many
function getUserInfo(id)
	return 'wzq', 33 ,160
end

print(getUserInfo(1))
name,age,height=getUserInfo(1)
print(name)


